package Q2.pojo;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import javax.persistence.Id;
import javax.persistence.Table;
import java.io.Serializable;
import java.sql.Blob;
import java.sql.Date;

/**
 * Student pojo
 *
 * @author chisheng
 */
@Data
@Table(name = "student")
@NoArgsConstructor
@AllArgsConstructor
public class Student implements Serializable {

    /**
     * Student identity
     */
    @Id
    private int id;

    /**
     * Student number
     */
    private String no;

    /**
     * Student name
     */
    private String name;

    /**
     * Student age
     */
    private int age;

    /**
     * Student birthday
     */
    private Date birthday;

    /**
     * Student image blob
     */
    private Blob photo;

    /**
     * Empty student entity, returned when data query is empty
     */
    public static final Student EMPTY_STUDENT = new Student(-1, "", "", -1, Date.valueOf("1970-01-01"), null);

}
